package com.xqx.user.service.impl;

import com.xqx.user.mapper.UserMapper;
import com.xqx.user.pojo.User;
import com.xqx.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author：xingquanxiang createTime：2019/10/14 14:20
 * description:
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    /**
     * 根据id查询用户
     *
     * @return
     */
    @Override
    public User findById(Long id) {
        return userMapper.selectByPrimaryKey(id);
    }

    /**
     * 添加用户信息
     *
     * @param user
     * @return
     */
    @Override
    public boolean save(User user) {
        return userMapper.insertSelective(user)==1;
    }
}
